package cn.wsalix.biz.type;

public enum CatTypeEnum {
	unknown("0", "未定"), article("admin/article", "文章"), ad("admin/ad", "广告"), shop(
			"admin/shop", "店铺");
	private String code;
	private String title;

	CatTypeEnum(String code, String title) {
		this.code = code;
		this.title = title;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public static CatTypeEnum findByCode(String code) {
		for (CatTypeEnum userKind : CatTypeEnum.values()) {
			if (userKind.getCode().equals(code)) {
				return userKind;
			}
		}
		return null;
	}

}
